import request from '@/router/axios'

export function getWorkContactList (query) {//获取客户管理列表
    return request({
        url: '/cp/workcontact/page',
        method: 'get',
        params: query
    })
}

export function synContact () {//同步客户
    return request({
        url: '/cp/workcontact/syncontact',
        method: 'put'
    })
}

export function synSource () {//客户来源下拉框
    return request({
        url: '/cp/workcontact/source',
        method: 'get'
    })
}

export function synDetail (query) {//查看客户详情基本信息
    return request({
        url: '/cp/workcontact/show',
        method: 'get',
        params: query
    })
}

export function synTrack (query) {//查看客户互动轨迹
    return request({
        url: '/cp/workcontact/track',
        method: 'get',
        params: query
    })
}

export function editSynDetail (obj, query) {//修改客户详情基本信息
    return request({
        url: '/cp/workcontact',
        method: 'put',
        data: obj,
        params: query
    })
}
export function getTagGroupList () {//获取标签分组列表
    return request({
        url: '/cp/workcontacttaggroup',
        method: 'get',
    })
}
export function setFieldpivot (obj) {//编辑用户画像
    return request({
        url: '/cp/contactfieldpivot',
        method: 'put',
        data: obj
    })
}

export function getFieldpivot (contactId) {//查看用户画像
    return request({
        url: '/cp/contactfieldpivot/' + contactId,
        method: 'get'
    })
}
// 新建客户标签组
export function createTagGroup (data) {
    return request({
        url: '/cp/workcontacttaggroup',
        method: 'post',
        data: data
    })
}